(function() {
    'use strict';

    /**
     * @ngdoc function
     * @name webApp.controller:MianfuCtrl
     * @description
     * # MianfuCtrl
     * Controller of the webApp
     */
    angular.module('webApp')
        .controller('MianfuCtrl', MianfuCtrl);

    MianfuCtrl.$inject = ['$scope', 'dataService', 'helper', 'dhfprinterService', '$timeout', '$interval', '$rootScope', '$state', 'cacheService', ];

    function MianfuCtrl($scope, dataService, helper, dhfprinterService, $timeout, $interval, $rootScope, $state, cacheService) {
        $scope.listAction = function(pageNo) {
            $scope.pageSize = 10;
            $scope.getItemList();
        }
        
        $scope.getItemList = function(pageNo) {
            var query = {
                content: {
                    page_no: pageNo ? pageNo : "1",
                    page_size: $scope.pageSize,
                    store_id: $rootScope.store_id
                }
            };
            dataService.mianfuGet(query).then(function(rest) {
                if (rest.mianfu_list) {
                    $scope.itemslist = rest.mianfu_list;
                    $scope.itemsTotal = rest.total_count;
                }
            });

        }

    }
})();